Skip to content

[MIG] 19.0: migration from 10.0#1

Draft
eantones wants to merge 7 commits into19.0from
19.0-mig-from-10.0
Draft

[MIG] 19.0: migration from 10.0#1
eantones wants to merge 7 commits into19.0from
19.0-mig-from-10.0

Conversation

@eantones
Copy link
Copy Markdown
Member

@eantones eantones commented Apr 8, 2026

Migrates the docker-odoo image from the 10.0 branch to support Odoo 19.0.

Changes

Split into 7 reviewable commits:

  1. Dockerfile: migrate base from Debian stretch to bookworm — Stretch has been EOL since 2022; Bookworm is what Odoo 19 officially targets.
  2. Dockerfile: install Odoo 19 system dependencies from apt — All python3-* packages mirroring odoo/odoo@19.0/debian/control, plus the fonts Odoo ships with.
  3. Dockerfile: create virtualenv at /opt/odoo/venv (PEP 668) — Debian 12+ blocks pip install --user. A venv with --system-site-packages reuses apt-installed python3-* while letting pip add git-aggregator, click-odoo-contrib, openupgradelib on top.
  4. Dockerfile: remove Node.js and less — Odoo 14+ compiles SCSS natively via python3-libsass. Saves ~80 MB and drops a dead dependency chain.
  5. Dockerfile: upgrade wkhtmltopdf to 0.12.6.1-3 for bookworm — Patched-Qt build required by Odoo; switch from dpkg -i to apt install ./wkhtml.deb for transitive dep resolution.
  6. scripts: migrate to Python 3common.sh drops --user (pip now runs inside the venv); genaddonspath.py shebang → python3 and removes the pipes.quote fallback.
  7. config: update defaults for Odoo 19PYTHON_BIN=/opt/odoo/venv/bin/python; constraints.txt reset (old pins were Python 2 era).

Target Odoo version

Odoo 19.0. The image assumes fetchcode will populate ${SRC_DIR}/odoo with the 19.0 branch via the instance repos.yaml. Same bootstrap flow as the 10.0 image, just a different branch.

Base OS / interpreter

  • debian:bookworm-slim (Debian 12)
  • Python 3.11 (system)
  • PostgreSQL client from bookworm-pgdg
  • wkhtmltopdf 0.12.6.1-3 (patched Qt)

Trixie was considered but ruled out because wkhtmltopdf only publishes .deb packages for bookworm, and the openupgradelib classifiers don't explicitly cover Python 3.13 yet.

Tooling versions (from PyPI / GitHub)

  • git-aggregator 4.1 (explicit Python 3.13 support)
  • openupgradelib — installed from master via git+https://github.com/OCA/openupgradelib.git (last commit 2026-04-08)
  • click-odoo-contrib — installed from PyPI

Instance config format

Unchanged. settings.env, repos.yaml and odoo.conf still use the same format as the 10.0 image. Only the content needs updating per instance (branch names, module lists, Odoo 19 options).

Not yet tested

This PR is draft because the image has not been built yet. Next steps before flipping to ready-for-review:

  • docker build the image on node56 (/srv/docker/images/odoo-19.0)
  • Boot a test instance with a minimal repos.yaml (just odoo/odoo@19.0)
  • Verify bootstrap succeeds (fetchcode, fetchreqs, genaddonspath)
  • Verify Odoo 19 starts and /web/database/selector responds
  • Verify wkhtmltopdf --version reports the patched-Qt build
  • Verify pip packages land in /opt/odoo/venv (not ~/.local)

eantones added 7 commits April 8, 2026 18:43
Stretch has been EOL since 2022. Bookworm is the current Debian
stable, and is what Odoo 19 officially targets (along with Noble).

Changes:
- FROM debian:stretch-slim -> debian:bookworm-slim
- Remove stretch EOL workarounds (archive.debian.org sed, pgdg stretch)
- Remove apt-transport-https (included in modern apt)

PostgreSQL client is still installed from the official pgdg repo but
pointing to bookworm-pgdg instead of stretch-pgdg (archive).
Odoo 19 is a Python 3 only codebase. Replace Python 2.7 with Python 3
and install all Odoo 19 runtime dependencies as native Debian packages
instead of pulling them through pip.

The list of python3-* packages mirrors the Depends/Recommends of
odoo/odoo's debian/control at the 19.0 tag. Installing from apt gives
us:
 - Consistent versions against the Bookworm Python 3.11 interpreter
 - Pre-compiled C extensions (no toolchain needed at runtime)
 - Security updates through unattended-upgrades

Also installed: the fonts Odoo ships with for web assets and PDF
rendering (fonts-dejavu-core, fonts-inconsolata, fonts-font-awesome,
fonts-roboto-unhinted), and libjs-underscore for the web client.

The build toolchain (gcc, *-dev) is kept for any pip package that
still needs to compile at bootstrap time via fetchreqs.
Since Debian 12 (PEP 668), pip can no longer install into the system
Python; it errors out with "externally-managed-environment". The 10.0
image relied on pip install --user which is now blocked.

Create a dedicated virtualenv at /opt/odoo/venv with
--system-site-packages so it can reuse the python3-* packages already
installed from apt (lxml, psycopg2, reportlab, gevent...) while still
letting pip install additional tooling such as git-aggregator,
click-odoo-contrib and openupgradelib on top.

The venv is owned by the odoo user so that fetchbasereqs/fetchreqs
can run as odoo without needing root. /opt/odoo/venv/bin is prepended
to PATH so "python" and "pip" resolve to the venv binaries.
Odoo 10 used the less CSS preprocessor at runtime to compile web
assets, which in turn required Node.js and the less npm package.

Starting with Odoo 14 the web framework compiles SCSS natively via
python3-libsass (already installed in the previous commit), so:

- Node.js 6.x is no longer required at all
- The less and less-plugin-clean-css npm packages are dropped

Removing Node saves ~80 MB from the image and eliminates a dependency
chain that has been stuck on a very old Node release (6.17.1) for
years.
Odoo's PDF rendering requires wkhtmltopdf built against the patched
Qt fork; the plain apt package from Debian (without patched Qt)
produces broken headers, footers and tables.

Use the official .deb built for bookworm from the wkhtmltopdf/
packaging releases. This is the last 0.12.x release (upstream is
deprecated but remains the reference build for Odoo).

Also switch from "dpkg -i" to "apt-get install ./wkhtml.deb" so that
any transitive dependency declared by the .deb is resolved
automatically instead of failing at install time.
Drop the Python 2 compatibility shims in the helper scripts:

scripts/lib/common.sh
  pip_install() no longer passes --user. Under Debian 12+ (PEP 668),
  --user is blocked against the system Python, and we now run pip
  from /opt/odoo/venv instead (prepended to PATH in the Dockerfile),
  so packages are installed into the venv automatically.

scripts/bin/genaddonspath.py
  Shebang changed from "#!/usr/bin/env python" to
  "#!/usr/bin/env python3".
  Removed the pipes.quote fallback; shlex.quote is available on all
  supported Python 3 versions.
config/defaults.env
  PYTHON_BIN now points to the venv interpreter
  (/opt/odoo/venv/bin/python). The venv sits first in PATH so bare
  "python" and "pip" resolve there too, but PYTHON_BIN is used
  explicitly by odoo_exec() to invoke odoo-bin.

config/constraints.txt
  Reset to an empty (commented) file. The previous pins
  (python-stdnum<2.0, Unidecode<1.3, isodate<0.7, zeep<4) were
  Python 2 era constraints for Odoo 10 and no longer apply: Odoo 19
  ships its own requirements.txt with much newer versions, and the
  base python3-* packages are already installed from apt.

  Instance-specific constraints can still be added to this file if
  an addon needs a particular version to be pinned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant